/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package uk.ac.bath.domains.sequence;

/**
 *
 * @author pjl
 */
public class Fitness {

    public float maxFitness=Float.MAX_VALUE;
    public float fitness=Float.MIN_VALUE;
    private boolean decided=false;

    public void addUpperBound(float x) {
        maxFitness = Math.min(maxFitness, x);
    }

    public boolean decided() {
       return decided;
    }

    public void finish() {
        decided=true;
        fitness=maxFitness;
    }

    /**
     *
     * @return upper bound
     */
    public float getMaximumFitness() {
        return maxFitness;
    }
    ;

    public void set(int fitness) {
        this.fitness=fitness;
        decided=true;
    }


    @Override
    public String toString() {
        if (decided) return "fitness="+ fitness;

        return " upper bound="+maxFitness;

    }
}
